<?php
    header("content-type:text/html;charset=utf-8");
    $config = include_once('../../public/config/config.php');
    include_once('../../public/func/db.php');
    $table = 'user';
    $res = select($config,$table,'where status = 8');
    if(md5($_POST['pwd']) == $res[0]['pwd']){
        $res[0]['pwd'] = md5($_POST['nowpwd']);
        update($config,$table,$res[0]);
        echo "<script>alert('密码修改成功!!!');
            window.location.href='/admin/login/login.php'</script>";
    }else{
        echo "<script>alert('密码修改失败!!!');
            window.location.href='/admin/login/doupdatepwd.php'</script>";
    }
?>